<div class="hot_container" >
  <h3>订单 NO<%=@order.id%></h3>
  <table class="order_list">
    <thead>
      <tr>
        <th colspan="8">商品明细</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td colspan="8">
          <table class="order_list">
            <tbody>
              <%  for li in @order.line_items %>
                <% if Product.exists?(li.product_id) %>
                  <% product = Product.find(li.product_id) %>
                  <tr>
                    <td>
                      <%= image_tag url_for_file_column(product, "image_url","thumb"),:class=>'product_img' %>
                    </td>
                    <td><%= h(product.name) %></td>
                    <td><%= h(product.size) %><%= h(product.unit) %></td>
                    <td>
                      &times;<%= li.quantity %>
                    </td>
                    <td class="price">
                      <%= li.price %>
                    </td>
                  </tr>
                <%end%>
              <%end%>
            </tbody>
          </table>
        </td>
      <tr>
        <td class="column1">下单时间</td>
        <td><%=@order.created_at.strftime("%y-%m-%d %I:%M%p")%></td>
        <td class="column1">订单状态</td>
        <td><%=format_status @order.status if @order.status%></td>
        <td class="column1">支付方式</td>
        <td><%=format_paytype @order.paytype if @order.paytype%></td>
        <td class="column1">总金额</td>
        <td><%=@order.total_price%></td>

      </tr>
      <tr>
        <td class="column1">送货方式</td>
        <td><%=format_shipping_type @order.shipping_type%></td>
        <td class="column1">送货日</td>
        <td><%= format_day @order.address.day if @order.address.day%></td>
        <td class="column1">送货时段</td>
        <td><%=format_timing @order.address.timing%></td>
        <td class="column1">账号</td>
        <td><%=@order.user.login%></td>
      </tr>
      <tr>
        <td colspan="8" style="text-align:left;">
          <%=@order.address.title if @order.address %></span>
        </td>
      </tr>
      <tr>
        <td colspan="8" style="text-align:left;">
          附言:<%=@order.remark%>
        </td>
      </tr>
      <% if admin? %>
        <tr>
          <td>订单状态</td>
          <td  style="text-align:left;" colspan="7">
            <% form_for @order do |f| %>
              <%=select("order", "status",Order::STATUS,:prompt => "请选择..")%>
              备注:<input name="order[pay_remark]" id="order_pay_remark" value='<%=h @order.pay_remark%>'></input>
              <%= submit_tag "修改",:confirm => '确定修改状态?'  %>
            <% end %>
          </td>
        </tr>
      <%end%>
    </tbody>
  </table>
  <%= link_to '返回', '/store/mine',:class=>'link_button' %>
</div>


